From 613849c82ae8ee2ef5124380986b50faac9909f9 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 19 Oct 2006 20:13:10 +0000 Subject: [PATCH] Fix interpolation when endpoints are same. From Vladimir Nadvornik. --- grtcirc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grtcirc.c b/grtcirc.c index 48c227b99..44ecf1adf 100644 --- a/grtcirc.c +++ b/grtcirc.c @@ -286,6 +286,10 @@ void linepart(double lat1, double lon1, double phi = 0; double cosphi = 0; double sinphi = 0; + + /* result must be in degrees */ + *reslat = lat1; + *reslon = lon1; /* degrees to radians */ lat1 = RAD(lat1); lon1 = RAD(lon1); @@ -306,8 +310,6 @@ void linepart(double lat1, double lon1, ya /= la; za /= la; } - *reslat = lat1; - *reslon = lon1; /* if la is zero, the points are either equal or directly opposite * each other. Either way, there's no single geodesic, so we punt. */ if ( la ) { -- 2.30.2